{% extends 'unfold/layouts/skeleton.html' %}

{% load i18n unfold %}

{% block base %}
    <div id="page" class="flex min-h-screen">
        {% if not is_popup and is_nav_sidebar_enabled %}
            {% block nav-sidebar %}
                {% include "admin/nav_sidebar.html" %}
            {% endblock %}
        {% endif %}

        <div id="main" class="flex-grow min-w-0">
            {% include "unfold/helpers/header.html" %}

            {% if not is_popup %}
                {% spaceless %}
                    {% block breadcrumbs %}
                        <div class="px-4 lg:px-8">
                            <div class="container mb-12 mx-auto -my-3">
                                <ul class="flex flex-wrap">
                                    {% url 'admin:index' as link %}
                                    {% trans 'Home' as name %}
                                    {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
                                    {% block custom_breadcrumbs %}{% endblock %}
                                </ul>
                            </div>
                        </div>
                    {% endblock %}
                {% endspaceless %}
            {% endif %}

            {% block messages %}
                <div class="px-4 lg:px-8">
                    <div class="{% if not cl.model_admin.list_fullwidth %}container{% endif %} mx-auto">
                        {% include "unfold/helpers/messages.html" %}
                    </div>
                </div>
            {% endblock messages %}

            <div class="px-4 pb-8 lg:px-8">
                <div id="content" class="{% if not cl.model_admin.list_fullwidth %}container{% endif %} mx-auto {% block coltype %}colM{% endblock %}">
                    {% if cl %}
                        {% tab_list "changelist" cl.opts %}
                    {% elif opts %}
                        {% tab_list "changeform" opts %}
                    {% endif %}

                    {% block content %}
                        {% block object-tools %}{% endblock %}

                        {{ content }}
                    {% endblock %}

                    {% block sidebar %}{% endblock %}
                </div>
            </div>

            {% block footer %}{% endblock %}
        </div>
    </div>
{% endblock %}
